/*
 * Tencent is pleased to support the open source community by making 蓝鲸 available.
 * Copyright (C) 2017-2022 THL A29 Limited, a Tencent company. All rights reserved.
 * Licensed under the MIT License (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 * http://opensource.org/licenses/MIT
 * Unless required by applicable law or agreed to in writing, software distributed under
 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 * either express or implied. See the License for the specific language governing permissions and
 * limitations under the License.
 */

@import '_vars.scss';
@import '_mixins.scss';

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    outline: none;
}

html,
body {
    height: 100%;
    overflow: hidden;
    font-family: -apple-system,BlinkMacSystemFont,PingFang SC,Microsoft YaHei,Helvetica Neue,Arial;
    color: $cmdbTextColor;
    background-color: #F5F7FA;
}

ul,
dl {
    list-style: none;
}

a,
a:hover,
a:active,
a:visited,
a:focus {
    text-decoration: none;
    color: $cmdbTextColor;
}

.clearfix {
    zoom: 1;

    &:before,
    &:after {
        content: "";
        display: table;
        clear: both;
    }
}

.fl {
    float: left;
}

.fr {
    float: right;
}

.f0 {
    font-size: 0;
}

[class*='icon-'] {
    display: inline-block;
    vertical-align: middle;
}

[hidden] {
    display: none;
}

input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder {
    color: #c3cdd7 !important;
    font-size: 12px;
}

[class^="icon-cc"], [class*=" icon-cc"] {
    /* use !important to prevent issues with browser extensions that change fonts */
    font-family: 'bk-cmdb' !important;
    speak: none;
    font-style: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    line-height: 1;

    /* Better Font Rendering =========== */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.inline-block-middle {
    display: inline-block;
    vertical-align: middle;
    outline: 0;
}

.bgc-white {
    background-color: #fff;
}

div.cmdb-form-item {
    position: relative;
    display: inline-block;
    width: 100%;

    &.is-error {
        input.cmdb-form-input {
            border-color: $cmdbDangerColor;
        }
        &.is-tooltips {
            input[type="text"],
            input[type="password"],
            input[type="number"],
            input[type="url"],
            textarea,
            select {
                border-color: $cmdbDangerColor;
                color: $cmdbDangerColor;
            }

            .bk-textarea-wrapper {
                border-color: $cmdbDangerColor;
            }

            .bk-tag-selector .bk-tag-input {
                border-color: $cmdbDangerColor;
            }

            .bk-form-tip {
                .bk-tip-text {
                    color: $cmdbDangerColor;
                }
            }

            .bk-select {
                border-color: $cmdbDangerColor;
            }
        }

        .form-error {
            position: absolute;
            top: 100%;
            left: 0;
            font-size: 12px;
            line-height: 16px;
            color: $cmdbDangerColor;
            max-width: 100%;
            @include ellipsis;
        }
    }

}

input.cmdb-form-input {
    width: 100%;
    height: 36px;
    padding: 0 10px;
    font-size: 14px;
    border: 1px solid $cmdbBorderColor;
    border-radius: 2px;
    outline: none;

    &:focus {
        border-color: $cmdbBorderFocusColor;
    }

    &:disabled {
        background-color: #fafafa;
        color: #aaa;
        cursor: not-allowed;
    }
}

.cmdb-form-radio {
    font-size: 14px;
    color: #737987;
    margin-right: 30px;
    line-height: 18px;
    display: inline-block;
    padding: 7px 0;

    .cmdb-radio-text {
        font-style: normal;
        font-weight: normal;
        cursor: pointer;
        vertical-align: middle;
    }

    input[type=radio] {
        width: 18px;
        height: 18px;
        outline: none;
        visibility: visible;
        cursor: pointer;
        vertical-align: middle;
        background-color: #fff;
        background-image: url('../images/checkbox-sprite.png');
        display: inline-block;
        background-position: 0 0;
        -webkit-appearance: none;

        margin: 0 5px 0 0;

        &:checked {
            background-position: -33px 0;

            &[disabled] {
                color: #ccc;
                background-position: -99px 0;
            }
        }

        &[disabled] {
            background-position: -66px 0;
            cursor: default;

            &+.bk-radio-text {
                color: #ccc;
                cursor: default;
            }
        }
    }

    &.cmdb-radio-small {
        input[type=radio] {
            width: 14px;
            height: 14px;
            background-position: 0 -33px;

            &:checked {
                background-position: -33px -33px;

                &[disabled] {
                    background-position: -99px -33px;
                }
            }

            &[disabled] {
                background-position: -66px -33px;
            }
        }
    }
}

.icon-triple-dot {
    display: inline-block;
    vertical-align: middle;
    width: 4px;
    height: 4px;
    background-color: #bec6de;
    box-shadow: 0 5px 0 #bec6de, 0 -5px 0 #bec6de;
}

.text-primary {
    color: #3c96ff !important;

    -webkit-appearance: none;
    border: none;
    outline: 0;
    background-color: transparent;
    cursor: pointer;
    &:hover {
        color: #0082ff !important;
    }

    &.disabled,
    &:disabled {
        color: #c4c6cc !important;
        cursor: not-allowed !important;
    }
}

.text-danger {
    color: #ff5656;

    &:hover {
        color: #f72239;
    }

    &.disabled,
    &:disabled {
        opacity: .385;
        cursor: not-allowed !important;
    }
}

.color-danger {
    color: #ff5656;
}
.color-warning {
    color: #ffb400;
}
.color-success {
    color: #30d878;
}

.mask {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
}

.collapse-transition {
    transition: .2s height ease-in-out, .2s padding-top ease-in-out, .2s padding-bottom ease-in-out
}

/* form-error -----------start----------- */

.form-component {
     --font-size: 12px !important
}

.form-component.error {

    input[name="date-select"],
    .bk-selector-input,
    .form-int-input,
    .form-float-input,
    .form-longchar-input,
    .form-singlechar-input,
    .member-container,
    .bk-select:not(.is-focus),
    .bk-form-input,
    .bk-textarea-wrapper,
    .bk-date-picker-editor,
    .user-selector-container {
        border-color: #ff5566;
    }
}

.form-component {
    .error{
        input[name="date-select"],
        .bk-selector-input,
        .form-int-input,
        .form-float-input,
        .form-longchar-input,
        .form-singlechar-input,
        .member-container,
        .bk-select:not(.is-focus),
        .bk-form-input,
        .bk-textarea-wrapper,
        .bk-date-picker-editor,
        .user-selector-container {
            border-color: #ff5566;
        }
    }
}


/* form-error -----------end----------- */


.v-cursor {
    background-repeat: no-repeat;
    background-position: center center;
    background-size: 12px 16px;
    background-image: url("../images/lock.svg");
}

.g-has-dashed-tooltips {
    cursor: pointer;
    position: relative;

    &::after {
        content: '';
        position: absolute;
        border-bottom: 1px dashed #979ba5;
        width: 100%;
        bottom: -4px;
        left: 0;
    }
}

.cmdb-config-sticky-layout {
    max-height: 100%;
    @include scrollbar-y;
    .layout-footer {
        display: flex;
        align-items: center;
        height: 52px;
        padding: 0 20px;
        .bk-button {
            min-width: 86px;

            & + .bk-button {
                margin-left: 8px;
            }
        }
        .auth-box {
            & + .bk-button,
            & + .auth-box {
                margin-left: 8px;
            }
        }
        &.is-sticky {
            background-color: #fff;
            border-top: 1px solid $borderColor;
        }
    }
  }

// siderslider抽屉组件标题文案过长样式
.bk-sideslider:not(.filter-form-sideslider) {
    .bk-sideslider-title {
        padding-left: 20px !important;
        cursor: pointer;
        @include ellipsis;
    }
}

.property-name-text {
    &.required:after{
        position: absolute;
        left: calc(100% + 2px) !important;
        top: 0;
        margin: 0 0 0 -10px;
        content: "*";
        color: #ff5656;
    }
}

.property-name-tooltips {
    color: #979BA5;
    &:hover {
        color: #63656E ;
    }
}

// 悬浮样式
.g-expand{
    position: absolute !important;
    width: 100%;
    z-index: 2;
    // 组件升级成2.5.9以上后，此处样式 可删除
    .bk-tag-input {
        height: 32px;
        &.active {
            height: auto;
        }
    }

    .bk-select, .bk-tag-input {
        width: 100%;
        &.is-focus, &.active {
            max-height: 400px;
        }
    }

    &.r0{
            right: 0;
        }
}
.no-expand {
    .g-expand {
        position: inherit !important;
    }
}

.g-cell-link-content {
    color: $primaryColor;
    cursor: pointer;
    @include ellipsis;

    &.disabled {
        color: #a3c5fd;
    }
}

/*
* 处理table一开始给空数据会闪过empty样式
*/
@keyframes table-empty-delay-show {
    from { opacity: 0; }
    to { opacity: 1; }
}

.bk-table-empty-block {
    animation: table-empty-delay-show .8s steps(1, end);
}
